home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6619 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.3 KB  |  82 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: What to do when feof() is NOT feof()
  5. Message-ID: <1996Feb19.063026.29889@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <4g7rsj$fnf@spectator.cris.com>
  11. Date: Mon, 19 Feb 1996 06:30:26 GMT
  12.  
  13. In article <4g7rsj$fnf@spectator.cris.com>, aubrey@concentric.net (Aubrey Harrison) writes:
  14. >In article <danpop.824614833@rscernix>, danpop@mail.cern.ch says...
  15. >>
  16. >>In <4g4vpp$52f@spectator.cris.com> aubrey@concentric.net (Aubrey Harrison) 
  17. >writes:
  18. >>
  19. >>
  20. >>>I think if you open the file in "text" mode the end of the file is indicated 
  21. >by 
  22. >>>the EOF marker (ASCII 26 I believe). To avoid this you must open the file in 
  23. >>>binary mode. 
  24. >>
  25. >>Once again: ignorants and idiots are kindly asked to refrain from posting
  26. >>their thoughts and beliefs to this newsgroup.
  27. >>
  28. >>If you don't KNOW what you're talking about, just keep your "mouth" shut.
  29. >>This is comp.lang.c, not talk.rumors.
  30. >>
  31. >>Dan
  32. >>--
  33. >>Dan Pop
  34. >>CERN, CN Division
  35. >>Email: danpop@mail.cern.ch 
  36. >>Mail:  CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
  37. >
  38. >Who died and left you king. Most of the messages I have read from you do 
  39. >nothing but harass and ridicule people, rarely ever offering an help or 
  40. >suggestions.
  41.  
  42. I would have to differ. Dan has always offered *correct* advice when it
  43. is called for. While I do not necessarily always agree with his way of
  44. doing so, his point here is still well taken.
  45.  
  46. When somebody is asking a question about something (that they are
  47. obviously unknowledgable or confused about), giving them incorrect
  48. answers only propagates the confusion. So please don't guess, please
  49. don't offer any incorrect suggestions, please don't confuse them
  50. further, etc.
  51.  
  52. >I may not be an expert but I know if you open a file with fopen( 
  53. >"filename", "rt"), then fgets stops reading when it finds a ascii 26 and 
  54. >signals end-of-file. If you open it with fopen( "filename","rb") it reads until 
  55. >the real end-of-file. I noticed in your smart-ass reply you did not offer any 
  56. >answers to his problem. Maybe you should take you own advice.
  57.  
  58. On my SunOS system, there is no such ascii 26 byte denoting end of file
  59. and fgets will *not* terminate in this manner. The point is that by
  60. making such incorrect responses (like you did by insisting on this
  61. point) is just plain wrong. It has nothing to do with the language or
  62. how the end of files are denoted in most operating systems. Even in
  63. PC's running MSDOS, there is no such requirement that there *must* be
  64. an ascii 26 at the end of text files. Certain editors (Brief is an
  65. example. microEMacs is another) can easily be configured to create such
  66. ascii files without this byte.
  67.  
  68. Note that even the EOF result returned (look in stdio.h) has nothing to
  69. do with the actual byte at the end of the file.
  70.  
  71. The bottom line still is: please do not offer answers if you do not
  72. know the correct answer.
  73.  
  74.                                 Z
  75.  
  76.  
  77. -- 
  78. -------------------------------------------------------------------------
  79. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  80. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  81. -------------------------------------------------------------------------
  82.